import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/HomeView_N.vue'),
    redirect: '/homepage',
    children: [
      {path:'/square',component: () => import('../views/square/SquareView.vue')},
      {path:'/order',component: () => import('../views/order/OrderView.vue')},
      {path:'/user',component: () => import('../views/user/UserView.vue')},
      {path:'/message',component: () => import('../views/user/MessageView.vue')},
      {path:'/setting',component: () => import('../views/user/SettingView.vue')},
      {path:'/more',component: () => import('@/views/menuItems/MoreFeaturesView.vue')},
      {path:'/classification',component: () => import('@/views/menuItems/ClassificationView.vue')},
      {path:'/homepage',component: () => import('../views/home/homePageView.vue')},
      {
        path:'/rider',
        name:'rider',
        component: () => import('../views/rider/RiderView.vue'),
        redirect: '/rider/homepage',
        children: [
          {path:'/rider/homepage',component: () => import('../views/rider/HomepageView.vue')},
          {path:'/rider/order',component: () => import('../views/rider/OrderListView.vue')},
          {path:'/rider/data',component: () => import('../views/rider/DataCenterView.vue')},
          {path:'/rider/income',component: () => import('../views/rider/IncomeView.vue')},
          {path:'/rider/appeal',component: () => import('../views/rider/AppealView.vue')},
          {path:'/rider/rules',component: () => import('../views/rider/RiderRulesView.vue')},
          {path:'/rider/setting',component: () => import('../views/rider/RiderSettings.vue')},
        ]
      },
      {path:'/become',component: () => import('../views/rider/BecomeRiderView.vue')}
    ]
  },
  {
    path:'/login',
    component: ()=>import('../views/Login.vue')
  },
  {
    path: '/:pathMatch(.*)*', name: 'NotFound', component: () => import('../views/exception/NotFoundView.vue')
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
